package net.wanho.shop.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import net.wanho.shop.service.MenuService;
import net.wanho.shop.vo.AjaxResult;
import net.wanho.shop.vo.MenuVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "04.菜单接口")
@RestController
@RequiredArgsConstructor
public class MenuController {

    private final MenuService menuService;

    @ApiOperation("菜单列表")
    @GetMapping("/menus")
    public AjaxResult menus() {
        List<MenuVo> list = menuService.findMenus();
        return AjaxResult.success(list);
    }


}